package com.netease.pris.activity.a;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.TextView;
import com.netease.image.c;
import java.util.LinkedList;

public class g extends BaseAdapter
{
  private int a;
  private int b;
  private LinkedList c;
  private Context d = null;
  private LayoutInflater e;

  public g(Context paramContext)
  {
    this.d = paramContext;
    this.e = ((LayoutInflater)paramContext.getSystemService("layout_inflater"));
    this.a = c.a(this.d, 104.0F);
    this.b = (com.netease.pris.a.u.n(this.d) / 2);
  }

  private void a(n paramn, com.netease.pris.atom.u paramu, int paramInt)
  {
    if ((paramn == null) || (paramu == null));
    label49: String str;
    while (true)
    {
      return;
      if (!paramu.V().equals("-1"))
        break;
      paramn.c.setVisibility(8);
      paramn.b.setScaleType(ImageView.ScaleType.CENTER);
      paramn.b.setImageResource(2130837508);
      paramn.c.setText(paramu.U());
      paramn.b.setImageDrawable(null);
      str = paramu.b(com.netease.pris.atom.g.g);
      if (str == null)
        continue;
      if (paramn.a > 0)
      {
        com.netease.image.d.a().a(paramn.a, 1);
        paramn.a = 0;
      }
      paramn.a = com.netease.b.a.d.f();
      if (paramn.b.getMeasuredWidth() <= 0)
        break label212;
    }
    label212: for (int i = paramn.b.getMeasuredWidth(); ; i = this.b)
    {
      this.b = i;
      StringBuilder localStringBuilder = new StringBuilder();
      paramn.b.setTag(localStringBuilder);
      com.netease.image.d.a().a(localStringBuilder, 2, str, new ac(this, paramn), this.b, this.a, 2, paramn.a);
      break;
      paramn.c.setVisibility(0);
      paramn.b.setScaleType(ImageView.ScaleType.CENTER_CROP);
      break label49;
    }
  }

  public com.netease.pris.atom.u a(int paramInt)
  {
    if (this.c != null)
      if (paramInt >= this.c.size())
        paramInt = -1 + this.c.size();
    for (com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.c.get(paramInt); ; localu = null)
      return localu;
  }

  public void a(LinkedList paramLinkedList)
  {
    this.c = paramLinkedList;
  }

  public int getCount()
  {
    int i = 0;
    if (this.c != null)
      i = this.c.size();
    return i;
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    n localn2;
    if (paramView == null)
    {
      paramView = this.e.inflate(2130903109, null);
      localn2 = new n(this);
      localn2.a = 0;
      localn2.b = ((ImageView)paramView.findViewById(2131558564));
      localn2.c = ((TextView)paramView.findViewById(2131558566));
      paramView.setTag(localn2);
    }
    for (n localn1 = localn2; ; localn1 = (n)paramView.getTag())
    {
      com.netease.pris.atom.u localu = a(paramInt);
      if (localu != null)
        a(localn1, localu, paramInt);
      return paramView;
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.a.g
 * JD-Core Version:    0.6.0
 */